1. Field of the Invention
This invention relates to microcontroller architectures, and more particularly, to a microcontroller with programmable embedded flash memory, which allows the programming or reprogramming of data into the flash memory to be conveniently carried out on-board.
2. Description of Related Art
A microcontroller is a "computer-on-one-chip" integrated circuit that comes with a complete microprocessor unit and embedded memory and input/output (I/O) units. The embedded memory is usually flash memory which is an erasable, reprogrammable kind of memory that permits a data block or groups of blocks to be erased and reprogrammed without having to erasing the entire memory. Conventionally, the programming of data into the flash memory should be performed off-board and requires the use of a dedicated writer to perform.
If a microcontroller is already soldered in position on a circuit board and reprogramming of data into its embedded flash memory is required, the entire IC package of the microcontroller should be dismounted from the circuit board before the reprogramming operation can be performed. Due to this drawback, in the event that any bugs are found in the embedded flash memory in the microcontroller after the circuit boards have been delivered to the customers, the repair would involve very laborious work. There exists, therefore, a need for a method that allows the reprogramming of data into the embedded flash memory in the microcontroller to be performed on-board without having to dismount the microcontroller from the circuit board.
Various solutions to the foregoing problem have been disclosed. For example, the U.S. Pat. No. 5,495,593 to Thomas et. al. teaches the use of serial port to perform the reprogramming of data into the embedded flash memory of microcontroller; and moreover, the U.S. Pat. No. 5,596,734 to Lawrence teaches the use of test pins for the reprogramming. These solutions, however, still have some drawbacks. First, they are not applicable to microcontrollers that are provided with no serial ports or test pins. For this kind of microcontrollers, the reprogramming requires the use of additional external circuits and modifications to the internal circuitry of the microcontroller. Second, the use of the serial port to perform the reprogramming is relative slow in speed. If the capacity of the embedded flash memory is large, it would take quite a lengthy period of time to complete the reprogramming.
FIG. 1 is a schematic block diagram showing a conventional architecture of microcontroller, as designated by the reference numeral I 0, which is mounted on a circuit board and connected via an interface 20 to a main unit (not shown) that is under control by the microcontroller 10. As shown, the microcontroller 10 includes a microprocessor unit 16 and a flash memory unit 12. The flash memory unit 12 is connected via an internal data bus 14 to the microprocessor unit 16, while the microprocessor unit 16 is connected via an external data bus 18 to the main-unit interface 20.
In operation, the microprocessor unit 16 executes a main control program fetched via the internal data bus 14 from the flash memory unit 12 to thereby perform a control function specific to the microcontroller 10. The control signals issued by the microprocessor unit 16 are then transferred via the external data bus 18 and the interface 20 to the main unit (not shown) which is under control by the microcontroller 10.
One drawback to the foregoing microcontroller system, however, is that when the flash memory unit 12 in the microcontroller 10 needs to be reprogrammed, the entire IC package of the microcontroller 10 should be dismounted from the circuit board and then mounted on a dedicated writer or programmer to write the new data into the flash memory unit 12. After the reprogramming is completed, the entire IC package of the microcontroller 10 is then remounted back onto the circuit board. The reprogramming is therefore quite inconvenient and time-consuming to perform.